#Boa:Dialog:GlobalOption

import wx

def create(parent):
    return GlobalOption(parent)

[wxID_GLOBALOPTION, wxID_GLOBALOPTIONESCIBUTTON, 
 wxID_GLOBALOPTIONGLOBALOPTIONTEXT, wxID_GLOBALOPTIONIPTEXT, 
 wxID_GLOBALOPTIONNOMETEXT, wxID_GLOBALOPTIONPASSWDTEXT, 
 wxID_GLOBALOPTIONPORTATEXT, wxID_GLOBALOPTIONRSYNCTEXT, 
 wxID_GLOBALOPTIONSALVABUTTON, wxID_GLOBALOPTIONSTATICTEXT1, 
 wxID_GLOBALOPTIONSTATICTEXT2, wxID_GLOBALOPTIONSTATICTEXT3, 
 wxID_GLOBALOPTIONSTATICTEXT4, wxID_GLOBALOPTIONSTATICTEXT5, 
 wxID_GLOBALOPTIONSTATICTEXT6, wxID_GLOBALOPTIONSTATICTEXT7, 
 wxID_GLOBALOPTIONUSERTEXT, 
] = [wx.NewId() for _init_ctrls in range(17)]

class GlobalOption(wx.Dialog):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self, id=wxID_GLOBALOPTION, name='GlobalOption',
              parent=prnt, pos=wx.Point(404, 367), size=wx.Size(338, 355),
              style=wx.DEFAULT_DIALOG_STYLE, title='GlobalOption')
        self.SetClientSize(wx.Size(330, 322))

        self.SalvaButton = wx.Button(id=wxID_GLOBALOPTIONSALVABUTTON,
              label='Salva', name='SalvaButton', parent=self, pos=wx.Point(56,
              288), size=wx.Size(75, 23), style=0)
        self.SalvaButton.Bind(wx.EVT_BUTTON, self.OnSalvaButtonButton,
              id=wxID_GLOBALOPTIONSALVABUTTON)

        self.EsciButton = wx.Button(id=wxID_GLOBALOPTIONESCIBUTTON,
              label='Esci', name='EsciButton', parent=self, pos=wx.Point(200,
              288), size=wx.Size(75, 23), style=0)
        self.EsciButton.Bind(wx.EVT_BUTTON, self.OnEsciButtonButton,
              id=wxID_GLOBALOPTIONESCIBUTTON)

        self.staticText1 = wx.StaticText(id=wxID_GLOBALOPTIONSTATICTEXT1,
              label='user', name='staticText1', parent=self, pos=wx.Point(16,
              56), size=wx.Size(48, 16), style=0)

        self.staticText2 = wx.StaticText(id=wxID_GLOBALOPTIONSTATICTEXT2,
              label='password', name='staticText2', parent=self,
              pos=wx.Point(16, 96), size=wx.Size(56, 16), style=0)

        self.staticText3 = wx.StaticText(id=wxID_GLOBALOPTIONSTATICTEXT3,
              label='ip server', name='staticText3', parent=self,
              pos=wx.Point(16, 136), size=wx.Size(64, 16), style=0)

        self.staticText4 = wx.StaticText(id=wxID_GLOBALOPTIONSTATICTEXT4,
              label='rsync command', name='staticText4', parent=self,
              pos=wx.Point(16, 176), size=wx.Size(80, 16), style=0)

        self.staticText5 = wx.StaticText(id=wxID_GLOBALOPTIONSTATICTEXT5,
              label='global option', name='staticText5', parent=self,
              pos=wx.Point(16, 216), size=wx.Size(80, 16), style=0)

        self.UserText = wx.TextCtrl(id=wxID_GLOBALOPTIONUSERTEXT,
              name='UserText', parent=self, pos=wx.Point(120, 48),
              size=wx.Size(200, 21), style=0, value='')

        self.PasswdText = wx.TextCtrl(id=wxID_GLOBALOPTIONPASSWDTEXT,
              name='PasswdText', parent=self, pos=wx.Point(120, 88),
              size=wx.Size(200, 21), style=wx.TE_PASSWORD, value='')

        self.IPText = wx.TextCtrl(id=wxID_GLOBALOPTIONIPTEXT, name='IPText',
              parent=self, pos=wx.Point(120, 128), size=wx.Size(200, 21),
              style=0, value='')

        self.rsyncText = wx.TextCtrl(id=wxID_GLOBALOPTIONRSYNCTEXT,
              name='rsyncText', parent=self, pos=wx.Point(120, 168),
              size=wx.Size(200, 21), style=0, value='')

        self.GlobalOptionText = wx.TextCtrl(id=wxID_GLOBALOPTIONGLOBALOPTIONTEXT,
              name='GlobalOptionText', parent=self, pos=wx.Point(120, 208),
              size=wx.Size(200, 21), style=0, value='')

        self.staticText6 = wx.StaticText(id=wxID_GLOBALOPTIONSTATICTEXT6,
              label='Porta', name='staticText6', parent=self, pos=wx.Point(16,
              256), size=wx.Size(80, 16), style=0)

        self.PortaText = wx.TextCtrl(id=wxID_GLOBALOPTIONPORTATEXT,
              name='PortaText', parent=self, pos=wx.Point(120, 248),
              size=wx.Size(200, 21), style=0, value='')

        self.NomeText = wx.TextCtrl(id=wxID_GLOBALOPTIONNOMETEXT,
              name='NomeText', parent=self, pos=wx.Point(120, 8),
              size=wx.Size(192, 21), style=0, value='')

        self.staticText7 = wx.StaticText(id=wxID_GLOBALOPTIONSTATICTEXT7,
              label='Nome client', name='staticText7', parent=self,
              pos=wx.Point(16, 16), size=wx.Size(55, 13), style=0)

    def __init__(self, parent, client):
        self._init_ctrls(parent)
        self.Client = client
        self.UserText.SetValue(self.Client['user'])
        self.IPText.SetValue(self.Client['ip'])
        self.PasswdText.SetValue(self.Client['password'])
        self.GlobalOptionText.SetValue(self.Client['option'])
        self.NomeText.SetValue(self.Client['name'])
        self.PortaText.SetValue(self.Client['port'])
        self.rsyncText.SetValue(self.Client['rsync'])

    def OnSalvaButtonButton(self, event):
        self.Client['user'] = self.UserText.GetValue()
        self.Client['password'] = self.PasswdText.GetValue()
        self.Client['ip'] = self.IPText.GetValue()
        self.Client['option'] = self.GlobalOptionText.GetValue()
        self.Client['rsync'] = self.rsyncText.GetValue()
        self.Client['name'] = self.NomeText.GetValue()
        self.Client['port'] = self.PortaText.GetValue()
        self.Close()
        
    def getValues(self):
        return self.Client

    def OnEsciButtonButton(self, event):
        self.Close()
